package com.hqyj.emb.system.service.Impl;

import com.hqyj.emb.system.dao.Impl.User2DaoImpl;
import com.hqyj.emb.system.dao.User2Dao;
import com.hqyj.emb.system.model.User2;
import com.hqyj.emb.system.service.User2Service;
import frame.model.PageBean;

import java.util.List;

public class User2ServiceImpl implements User2Service {
    User2Dao user2Dao=new User2DaoImpl();

    @Override
    public PageBean<User2> queryAllPage(int pc, int ps) {
        PageBean<User2> pb = new PageBean<User2>();
        pb.setPc(pc);
        pb.setPs(ps);

        // 查询总记录数:总记录数（total record）
        int tr = user2Dao.queryUser2TotalRecord();
        pb.setTr(tr);

        // 查询当前页的记录
        List<User2> beanList = user2Dao.queryCurrentPageDataList((pc - 1) * ps, ps);
        pb.setBeanList(beanList);
        return pb;
    }
}
